/**
 * LetterX.java | Created on 30 08 2010
 */
package com.pacm.letter;

/**
 * The letter X implementation
 *
 * @author Paul Augustine C. Mendoza
 */
public class LetterX extends AbstractLetter {

    public LetterX(int size) {
        super(size);
    }

    public void buildLetter() {
        String[][] matrix = getMatrix();
        for (int rowIndex = 0; rowIndex < matrix.length; rowIndex++) {
            String[] row = matrix[rowIndex];
            for (int colIndex = 0; colIndex < row.length; colIndex++) {
                if ((rowIndex == colIndex) || (colIndex == (getMaxIndex() - rowIndex))) {
                    setCharacterMark(rowIndex, colIndex);
                } else {
                    setSpaceMark(rowIndex, colIndex);
                }
            }
        }
    }

}
